home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / vbcc / machines / amiga68k / libsrc / stdio / setvbuf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-13  |  320 b   |  17 lines

  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int setvbuf(FILE *f,char *buf,int mode,size_t size)
  5. {
  6.     if(mode==_IONBF) f->flags|=_UNBUF; else f->flags&=~_UNBUF;
  7.     f->bufsize=size;
  8.     if(buf){
  9.         f->base=buf;
  10.     }else{
  11.         if(!(f->base=(char *)malloc(size+1)+1))
  12.             return(EOF);
  13.     }
  14.     return(0);
  15. }
  16.  
  17.